package lab02.test34;

/**
 * Created by ASUS on 2017/11/20.
 */
import java.util.ArrayList;
import java.util.List;
public class Test {
    public static void main(String[] args) {
        String[] arr = new String[]{"apple","grape","banana","pear"};
        String term;

        for (int i = 0 ; i < arr.length ;i ++){
            for (int j  = i + 1 ; j < arr.length ; j ++){

                if (arr[i].compareToIgnoreCase(arr[j])>0){
                    term=arr[i];
                    arr[i]=arr[j];
                    arr[j]=term;
                }
            }
        }

        System.out.println("最小值："+arr[0]+"\n"+"最大值："+arr[3]);

        for (String x :arr){
            System.out.println(x);
        }
    }
}
